package com.px.gis.entity;


import cn.hutool.core.lang.Snowflake;
import cn.hutool.json.JSONArray;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import lombok.experimental.Accessors;
import org.postgis.Geometry;

import java.util.List;

@Data
@Accessors(chain = true)
@TableName("area")
public class Area {
    @TableId
    public Long areaId = new Snowflake().nextId();

    public Long parentId;

    public String idPath;

    public String name;

    public Integer type;

    String address;

    Integer beginAt;

    Integer endAt;

    String city;

    String color;

    String country;

    Integer dataSource;

    String description;

    Double height;

    Double lat;

    Double lng;

    Integer level;

    Geometry polygon;

    Double radius;

    Integer shape;

    String url;

    boolean external;

    @TableField(exist = false)
    String polygonJson;

    @TableField(exist = false)
    JSONArray polygonPoints;

    @TableField(exist = false)
    List<Area> subAreas;
}
